﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace eventr.Controls
{
    public class DefaultComboBox : ComboBox
    {
        protected override void OnItemsChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
        {
            base.OnItemsChanged(e);

            IsSettingDefault = true;
            if (base.SelectedIndex == -1)
                base.SelectedIndex = 0;
            IsSettingDefault = false;
        }

        public bool IsSettingDefault { get; set; }
    }
}
